package com.freshmarket.freshmarket.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.freshmarket.freshmarket.entity.Product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Squirrel
 * @since 2020-09-04
 */
public interface ProductMapper extends BaseMapper<Product> {
@Select("SELECT * FROM freshmarket_product fp LEFT JOIN freshmarket_product_type fpt ON fp.product_type_id=fpt.product_type_id WHERE fpt.product_type_name=#{productType}")
    List<Product> selectProduct(String productType);
@Select("select * from freshmarket_product")
    List<Product> selectAll();

    IPage<Product> queryProduct(Page<Object> objectPage, String productName, String productType);
}
